<?php /* Smarty version 2.6.18, created on 2016-12-30 12:15:55
         compiled from index.footer.tpl.php */ ?>
	<footer class="main-footer" style="padding-bottom:40px;">
    <strong>Copyright &copy; <?php echo $this->_tpl_vars['system_ini']['baseset_name']; ?>
 版权所有</strong> All rights
    reserved.
  </footer>
</div>
<div>
 <nav class="navbar-fixed-bottom" style="height:30px; margin:0px; margin-left:230px;">
      <ul class="row" style="margin:0px; padding:0px;" id="history_list" >

      </ul>
 </nav>
</div>
<!-- ./wrapper -->


<!-- jQuery 2.2.0 -->
<script src="static/js/jQuery-2.2.0.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/select2.min.js"></script>
<script src="static/js/app.min.js"></script>
<script src="static/js/demo.js"></script>
<script src="static/js/jquery-ui.js"></script>
<script src="static/js/jquery-ui-timepicker-addon.js"></script>
<?php if ($this->_tpl_vars['a'] == 'default.index'): ?>
<script>
  $(function(){
	  $("#shang").html('<iframe allowtransparency="true" style="margin-top:10px;" frameborder="0" width="180" height="36" scrolling="no" src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=3&bd=0&k=&f=&q=1&e=1&a=1&c=54511&w=180&h=36&align=left"></iframe>');
	  })
</script>
<?php endif; ?>




<script src="static/js/jquery.cookie.js"></script>

 <script type="text/javascript">
 $(function(){
 var art_title = $("title").html();


strs = art_title.split("|"); 
art_title = strs[0];
art_title = $.trim(art_title);

 var art_url = document.URL;
 var history;
 var json="[";
 //json1是第一次注入cookie以后的第一个json，"此时还不是数组" 以点带面的处理
 var json1;
 var canAdd= true;
 //var json1=eval("({sitename:'dreamdu',sitedate:new Date(1980, 12, 17, 12, 0, 0)})");
 if(!$.cookie("history") && art_title!=""){
 //第一次的时候需要初始化
 history = $.cookie("history","{title:\""+art_title+"\""+",url:\""+art_url+"\"}");
 }else {
 //已经存在
 history = $.cookie("history");
 json1 = eval("("+history+")");
 $(json1).each(function(){
  if(this.title==art_title){
  canAdd=false;
  return false;
  }
 })
 if(canAdd && art_title!=""){
  $(json1).each(function(){
  json = json + "{\"title\":\""+this.title+"\",\"url\":\""+this.url+"\"},";
  })
  json = json + "{\"title\":\""+art_title+"\",\"url\":\""+art_url+"\"}]"; 
  $.cookie("history",json,{expires:1});
 }
 }
 })
 </script>
 <script type="text/javascript">
 $(function(){ 
 if($.cookie("history")){

 var json = eval("(" +$.cookie("history")+")");
 var list =""; 
 var i=0;
 var len = (json).length;
     //alert(len);
     if(typeof(len) == "undefined"){
         len = 1;
     }
     if(len>5){
         i = len - 5;
     }
     for(i=i;i<=len;i++){
         var xx = json[i];
         if(xx){

            list = list + "<li class='col-sm-2' id='number"+i+"'><a href='"+xx['url']+"'>"+xx.title+"</a> <i class='fa fa-close (alias)' onclick=\"clearcookie("+i+",'"+xx.title+"')\"></i></li>";
         }
     }
// $(json).each(function(){
//	i++;
//     //alert(i);
//     if(i>5){
//
//         $("#history_list li:first i").click();
//
//     }
//   list = list + "<li class='col-sm-2' id='number"+i+"'><a href='"+this.url+"'>"+this.title+"</a> <i class='fa fa-close (alias)' onclick=\"clearcookie("+i+",'"+this.title+"')\"></i></li>";
// })
 $("#history_list").html(list);

 } 
 });

function clearcookie(id, art_title){
				$.cookie("history", "", {expires:1});
				var history;
				var json="[";
				var json1;
				var cid = "#number"+id;
				 $(cid).remove();
				 history = $.cookie("history");
				 json1 = eval("("+history+")");
				$.cookie("history", "", {expires:1});

				 $(json1).each(function(){

				  if(this.title == art_title){

				  }else{
					json = json + "{\"title\":\""+this.title+"\",\"url\":\""+this.url+"\"}";   
					  }
				 })

				json = json + "]";


				 $.cookie("history", json, {expires:1});
	}

 </script>

</body>
</html>
